home *** CD-ROM | disk | FTP | other *** search
/ ETO Development Tools 4 / ETO Development Tools 4.iso / Essentials / MacApp Documentation / MacApp.TECH$ Archives / 1991 / Jan 91 / MacApp.Tech$ 1⁄25⁄91 / 2764-Re TTEView text line-Jan91 < prev    next >
Encoding:
Text File  |  1991-03-06  |  1.4 KB  |  41 lines  |  [TEXT/GEOL]

  1. Item    5709739                         21-Jan-91        07:33PST
  2.  
  3. From:   DAWSON.M                        Dawson, Mark
  4.  
  5. To:     LALEKERMAC                      CSX Technology, W Laleker,SSF,PAS
  6.         MACAPP.TECH$                    MacApp Technical
  7.  
  8. ------------------------------------------------------------------------------
  9.  
  10. Sub:    Re: TTEView text lines problem
  11.  
  12. >I am trying to stuff text into a TTEView from an array of strings.  Each
  13. > string in the array is to be a separate line in the view.
  14. >
  15. >I have tried embedding carriage returns in the text handle and installing it
  16. >in the view and the trouble is that only the first string is visible until I
  17. >type a character in the view.  At that point the other lines become visible.
  18. >
  19. >Before I go beating down many other paths, could someone give me a hint?
  20.  
  21. Lori,
  22. I've run across this problem, and here's my solution (I'm doing this inside
  23. of my TDTextDocument:AppendText(Str255 text) routine):
  24.  
  25. ..
  26. fTEView->Focus();
  27. TESetSelect(32767,32767,fTEView->fHTE);
  28. ...
  29. TEInsert((Ptr)&text[1],len,fTEView->fHTE);
  30. ..
  31. fTEView->SynchView(TRUE);
  32. fTEView->DrawContents();
  33. ...
  34. If I leave out any of these steps, the text insertion doesn't appear (until I
  35. add more text via typing it in).  It seems a little like black magic--I played
  36. around with every updating routine I could think of before I came across the
  37. above formula.  Hope this helps,
  38.  
  39. Mark
  40.  
  41.